<?php
@session_start();
?>
<?php
@session_start();
?>
<?php
@session_start();
?>
<?php require_once('../Connections/elevate954.php'); ?>
<?php require_once("../webassist/form_validations/wavt_scripts_php.php"); ?>
<?php require_once("../webassist/form_validations/wavt_validatedform_php.php"); ?>
<?php require_once( "../webassist/security_assist/helper_php.php" ); ?>
<?php 
if (isset($_POST["LogIn_submit"]))  {
  $WAFV_Redirect = "".(htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES))  ."?invalid=true";
  $_SESSION['WAVT_loginmembers_Errors'] = "";
  if ($WAFV_Redirect == "")  {
    $WAFV_Redirect = $_SERVER["PHP_SELF"];
  }
  $WAFV_Errors = "";
  $WAFV_Errors .= WAValidateRQ((isset($_POST["Log_In_group_MEMBER_USERNAME"])?$_POST["Log_In_group_MEMBER_USERNAME"]:"") . "",true,1);
  $WAFV_Errors .= WAValidateEL((isset($_POST["Log_In_group_MEMBER_USERNAME"])?$_POST["Log_In_group_MEMBER_USERNAME"]:"") . "",6,100,true,2);
  $WAFV_Errors .= WAValidateRQ((isset($_POST["Log_In_group_MEMBER_PASSWORD"])?$_POST["Log_In_group_MEMBER_PASSWORD"]:"") . "",true,3);
  $WAFV_Errors .= WAValidateEL((isset($_POST["Log_In_group_MEMBER_PASSWORD"])?$_POST["Log_In_group_MEMBER_PASSWORD"]:"") . "",6,500,true,4);

  if ($WAFV_Errors != "")  {
    PostResult($WAFV_Redirect,$WAFV_Errors,"loginmembers");
  }
}
?>
<?php
if ((isset($_POST["LogIn_submit"])&&(!isset($_POST["Log_In_group_Remember_my_information"])) && $_POST["LogIn_submit"] != "")) {
	setcookie("RememberMePWD", "", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if ((isset($_POST["LogIn_submit"])&&(!isset($_POST["Log_In_group_Remember_my_information"])) && $_POST["LogIn_submit"] != "")) {
	setcookie("RememberMeUN", "", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if ((isset($_POST["LogIn_submit"])&&(isset($_POST["Log_In_group_Remember_my_information"])) && $_POST["Log_In_group_Remember_my_information"] != "")) {
	setcookie("RememberMePWD", "".((isset($_POST["Log_In_group_MEMBER_PASSWORD"]))?$_POST["Log_In_group_MEMBER_PASSWORD"]:"")  ."", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if ((isset($_POST["LogIn_submit"])&&(isset($_POST["Log_In_group_Remember_my_information"])) && $_POST["Log_In_group_Remember_my_information"] != "")) {
	setcookie("RememberMeUN", "".((isset($_POST["Log_In_group_MEMBER_USERNAME"]))?$_POST["Log_In_group_MEMBER_USERNAME"]:"")  ."", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if ((isset($_POST["LogIn_submit"])&&(!isset($_POST["Log_In_group_Log_me_in_automatically"])) && $_POST["LogIn_submit"] != "")) {
	setcookie("AutoLoginPWD", "", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if ((isset($_POST["LogIn_submit"])&&(!isset($_POST["Log_In_group_Log_me_in_automatically"])) && $_POST["LogIn_submit"] != "")) {
	setcookie("AutoLoginUN", "", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if ((isset($_POST["LogIn_submit"])&&(isset($_POST["Log_In_group_Log_me_in_automatically"])) && $_POST["Log_In_group_Log_me_in_automatically"] != "")) {
	setcookie("AutoLoginPWD", "".((isset($_POST["Log_In_group_MEMBER_PASSWORD"]))?$_POST["Log_In_group_MEMBER_PASSWORD"]:"")  ."", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if ((isset($_POST["LogIn_submit"])&&(isset($_POST["Log_In_group_Log_me_in_automatically"])) && $_POST["Log_In_group_Log_me_in_automatically"] != "")) {
	setcookie("AutoLoginUN", "".((isset($_POST["Log_In_group_MEMBER_USERNAME"]))?$_POST["Log_In_group_MEMBER_USERNAME"]:"")  ."", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if($_SERVER["REQUEST_METHOD"] == "POST"){
	$WA_Auth_Parameter = array(
	"connection" => $elevate954,
	"database" => $database_elevate954,
	"tableName" => "MEMBERS",
	"columns" => explode($WA_Auth_Separator,"MEMBER_USERNAME".$WA_Auth_Separator."MEMBER_PASSWORD"),
	"columnValues" => explode($WA_Auth_Separator,"".((isset($_POST["Log_In_group_MEMBER_USERNAME"]))?$_POST["Log_In_group_MEMBER_USERNAME"]:"")  ."".$WA_Auth_Separator."".((isset($_POST["Log_In_group_MEMBER_PASSWORD"]))?$_POST["Log_In_group_MEMBER_PASSWORD"]:"")  .""),
	"columnTypes" => explode($WA_Auth_Separator,"text".$WA_Auth_Separator."text"),
	"sessionColumns" => explode($WA_Auth_Separator,"id".$WA_Auth_Separator."COMPANY_NAME".$WA_Auth_Separator."MEMBER_FIRST_NAME".$WA_Auth_Separator."MEMBER_LAST_NAME".$WA_Auth_Separator."ADDRESS".$WA_Auth_Separator."ADDRESS2".$WA_Auth_Separator."CITY".$WA_Auth_Separator."STATE".$WA_Auth_Separator."ZIP".$WA_Auth_Separator."PHONE_NUMBER".$WA_Auth_Separator."FAX_NUMBER".$WA_Auth_Separator."EMAIL".$WA_Auth_Separator."COMPANY_LOGO".$WA_Auth_Separator."COMPANY_SLOGAN".$WA_Auth_Separator."MEMBER_USERNAME".$WA_Auth_Separator."MEMBER_PASSWORD"),
	"sessionNames" => explode($WA_Auth_Separator,"SecurityAssist_id".$WA_Auth_Separator."COMPANY_NAME".$WA_Auth_Separator."MEMBER_FIRST_NAME".$WA_Auth_Separator."MEMBER_LAST_NAME".$WA_Auth_Separator."ADDRESS".$WA_Auth_Separator."ADDRESS2".$WA_Auth_Separator."CITY".$WA_Auth_Separator."STATE".$WA_Auth_Separator."ZIP".$WA_Auth_Separator."PHONE_NUMBER".$WA_Auth_Separator."FAX_NUMBER".$WA_Auth_Separator."EMAIL".$WA_Auth_Separator."COMPANY_LOGO".$WA_Auth_Separator."COMPANY_SLOGAN".$WA_Auth_Separator."MEMBER_USERNAME".$WA_Auth_Separator."MEMBER_PASSWORD"),
	"successRedirect" => "/members/dashboard.php?loggedIn=1",
	"failRedirect" => "login.php?failedLogin=1",
	"gotoPreviousURL" => TRUE,
	"keepQueryString" => TRUE
	);
	
	WA_AuthenticateUser($WA_Auth_Parameter);
}
?>
<?php
if((((isset($_SESSION["SecurityAssist_id"]) && $_SESSION["SecurityAssist_id"] != "")?"LoggedIn":"") == "")&&(((isset($_COOKIE["AutoLoginUN"]))?$_COOKIE["AutoLoginUN"]:"") != "")&&(((isset($_COOKIE["AutoLoginPWD"]))?$_COOKIE["AutoLoginPWD"]:"") != "")){
	$WA_Auth_Parameter = array(
	"connection" => $elevate954,
	"database" => $database_elevate954,
	"tableName" => "MEMBERS",
	"columns" => explode($WA_Auth_Separator,"MEMBER_USERNAME".$WA_Auth_Separator."MEMBER_PASSWORD"),
	"columnValues" => explode($WA_Auth_Separator,"".((isset($_COOKIE["AutoLoginUN"]))?$_COOKIE["AutoLoginUN"]:"")  ."".$WA_Auth_Separator."".((isset($_COOKIE["AutoLoginPWD"]))?$_COOKIE["AutoLoginPWD"]:"")  .""),
	"columnTypes" => explode($WA_Auth_Separator,"text".$WA_Auth_Separator."text"),
	"sessionColumns" => explode($WA_Auth_Separator,"id"),
	"sessionNames" => explode($WA_Auth_Separator,"SecurityAssist_id"),
	"successRedirect" => "",
	"failRedirect" => "",
	"gotoPreviousURL" => TRUE,
	"keepQueryString" => TRUE
	);
	
	WA_AuthenticateUser($WA_Auth_Parameter);
}
?>
<!DOCTYPE html>
<!-- 
Template Name: Conquer - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.0.3
Version: 1.5.2
Author: KeenThemes
Website: http://www.keenthemes.com/
Purchase: http://themeforest.net/item/conquer-responsive-admin-dashboard-template/3716838?ref=keenthemes
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8"/>
<title>Conquer | Login</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<meta content="" name="description"/>
<meta content="" name="author"/>
<meta name="MobileOptimized" content="320">
<!-- BEGIN GLOBAL MANDATORY STYLES -->
<link href="assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
<link href="assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="assets/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
<!-- END GLOBAL MANDATORY STYLES -->
<!-- BEGIN PAGE LEVEL STYLES -->
<link rel="stylesheet" type="text/css" href="assets/plugins/select2/select2_conquer.css"/>
<!-- END PAGE LEVEL SCRIPTS -->
<!-- BEGIN THEME STYLES -->
<link href="assets/css/style-conquer.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/style.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/plugins.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color"/>
<link href="assets/css/pages/login.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/custom.css" rel="stylesheet" type="text/css"/>
<!-- END THEME STYLES -->
<link rel="shortcut icon" href="favicon.ico"/>
</head>
<!-- BEGIN BODY -->
<body class="login">
<!-- BEGIN LOGO -->
<div class="logo">
	<img src="images/Black_Transparent.png" alt="" width="300"/>
</div>
<!-- END LOGO -->
<!-- BEGIN LOGIN -->
<div class="content">
	<!-- BEGIN LOGIN FORM -->
	<?php if(WA_Auth_RulePasses("Validated form")){ // Begin Show Region ?>
<p>Invalid username or password</p>
<?php } // End Show Region ?>
<?php if(WA_Auth_RulePasses("Log in success")){ // Begin Show Region ?>
<p>You have been logged in</p>
<?php } // End Show Region ?>
<?php if(WA_Auth_RulePasses("Failed log in")){ // Begin Show Region ?>
<p>Invalid username or password</p>
<?php } // End Show Region ?>
<?php if(WA_Auth_RulePasses("Emailed password")){ // Begin Show Region ?>
<p>Password information emailed, please check your inbox</p>
<?php } // End Show Region ?>
<?php if(WA_Auth_RulePasses("Successful update")){ // Begin Show Region ?>
<p>Registration completed successfully, please log in to access the site</p>
<?php } // End Show Region ?>
<div id="LogInContainer" class="WAATK">
  <div id="LogIn_Basic_Default_ProgressWrapper">
    <form class="Basic_Default" id="LogIn_Basic_Default" name="LogIn_Basic_Default" method="post" action="<?php echo (htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)); ?>">
      <fieldset class="Basic_Default" id="Log_In">
        <legend class="groupHeader">Log In</legend>
        <span class="fieldsetDescription"> Required * </span>
        <div class="lineGroup">
          <label for="Log_In_group_MEMBER_USERNAME" class="sublabel" > <strong>MEMBER USERNAME:<span class="requiredIndicator">&nbsp;*</span></strong></label>
          <div class="errorGroup"> <span id="Log_In_group_MEMBER_USERNAME_Spry"> <span>
            <input name="Log_In_group_MEMBER_USERNAME" type="text" class="form-control placeholder-no-fix" id="Log_In_group_MEMBER_USERNAME" placeholder="ENTER YOUR USERNAME" tabindex="1" onBlur="hideServerError('Log_In_group_MEMBER_USERNAME_ServerError');" value="<?php echo ((isset($_COOKIE["RememberMeUN"]))?$_COOKIE["RememberMeUN"]:""); ?>">
            <br>
<?php
if (ValidatedField('loginmembers','loginmembers'))  {
  if ((strpos((",".ValidatedField("loginmembers","loginmembers").","), "," . "1" . ",") !== false || "1" == "") || (strpos((",".ValidatedField("loginmembers","loginmembers").","), "," . "2" . ",") !== false || "2" == ""))  {
    if (!(false))  {
?>
              <span class="serverInvalidState" id="Log_In_group_MEMBER_USERNAME_ServerError">Please enter a value.</span>
              <?php //WAFV_Conditional login_members.php loginmembers(1,2:)
    }
  }
}?>
 </span> </span> </div>
        </div>
        <div class="lineGroup">
          <label for="Log_In_group_MEMBER_PASSWORD" class="sublabel" > <strong>MEMBER PASSWORD:<span class="requiredIndicator">&nbsp;*</span></strong></label>
          <div class="errorGroup"> <span id="Log_In_group_MEMBER_PASSWORD_Spry"> <span>
            <input name="Log_In_group_MEMBER_PASSWORD" type="password" class="form-control placeholder-no-fix" id="Log_In_group_MEMBER_PASSWORD" placeholder="ENTER YOUR PASSWORD" tabindex="2" onBlur="hideServerError('Log_In_group_MEMBER_PASSWORD_ServerError');" value="<?php echo ((isset($_GET["failedLogin"]) || isset($_GET["invalid"]))?"":((isset($_COOKIE["RememberMePWD"]))?$_COOKIE["RememberMePWD"]:"")); ?>">
            <br>
<?php
if (ValidatedField('loginmembers','loginmembers'))  {
  if ((strpos((",".ValidatedField("loginmembers","loginmembers").","), "," . "3" . ",") !== false || "3" == "") || (strpos((",".ValidatedField("loginmembers","loginmembers").","), "," . "4" . ",") !== false || "4" == ""))  {
    if (!(false))  {
?>
              <span class="serverInvalidState" id="Log_In_group_MEMBER_PASSWORD_ServerError">Please enter a value.</span>
              <?php //WAFV_Conditional login_members.php loginmembers(3,4:)
    }
  }
}?><br>

 </span> </span> </div>
        </div>
        <div class="lineGroup">
          <div class="errorGroup"> <span>
            <label class="checklabel" for="Log_In_group_Remember_my_information">
              <input type="checkbox" name="Log_In_group_Remember_my_information" id="Log_In_group_Remember_my_information" value="1" class="formCheckboxField_Standard"<?php if (!(strcmp(((isset($_COOKIE["RememberMeUN"]))?1:0),1))) {echo "checked=\"checked\"";} ?> tabindex="3">
              &nbsp;Remember my information</label>
          </span> </div>
        </div>
        <div class="lineGroup">
          <div class="errorGroup"> <span>
            <label class="checklabel" for="Log_In_group_Log_me_in_automatically">
              <input type="checkbox" name="Log_In_group_Log_me_in_automatically" id="Log_In_group_Log_me_in_automatically" value="1" class="formCheckboxField_Standard"<?php if (!(strcmp(((isset($_COOKIE["AutoLoginUN"]))?1:0),1))) {echo "checked=\"checked\"";} ?> tabindex="4">
              &nbsp;Log me in automatically</label>
          </span> </div>
        </div>
        <span class="buttonFieldGroup" >
          <input class="button highlight action" name="LogIn_submit" type="submit" id="LogIn_submit" value="Log In"  onClick="clearAllServerErrors('LogIn_Basic_Default')" tabindex="4">
        </span>
      </fieldset>
    </form>
  </div>
  <div id="LogIn_Basic_Default_ProgressMessageWrapper" class="blockUIOverlay" style="display:none;">
    <script type="text/javascript">
WADFP_SetProgressToForm('LogIn_Basic_Default', 'LogIn_Basic_Default_ProgressMessageWrapper', WADFP_Theme_Options['BigSpin:Slate']);
  </script>
    <div id="LogIn_Basic_Default_ProgressMessage" >
      <p style="margin:10px; padding:5px;" ><img src="webassist/progress_bar/images/slate-largespin.gif" alt="" title="" style="vertical-align:middle;" />&nbsp;&nbsp;Please wait</p>
    </div>
  </div>
</div>
<script type="text/javascript">
<!--
var Log_In_group_MEMBER_USERNAME_Spry = new Spry.Widget.ValidationPassword("Log_In_group_MEMBER_USERNAME_Spry", { minChars:6, maxChars:100, isRequired:true , validateOn:["blur"]});
var Log_In_group_MEMBER_PASSWORD_Spry = new Spry.Widget.ValidationPassword("Log_In_group_MEMBER_PASSWORD_Spry", { minAlphaChars:3, maxAlphaChars:500, minNumbers:2, maxNumbers:500, minSpecialChars:0, maxSpecialChars:0, minChars:6, maxChars:500, isRequired:true , validateOn:["blur"]});
//-->
</script>
	<!-- END REGISTRATION FORM -->
</div>
<!-- END LOGIN -->
<!-- BEGIN COPYRIGHT -->
<div class="copyright">
2013 &copy;ELEVATE954</div>
<!-- END COPYRIGHT -->
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- BEGIN CORE PLUGINS -->
<!--[if lt IE 9]>
<script src="assets/plugins/respond.min.js"></script>
<script src="assets/plugins/excanvas.min.js"></script> 
<![endif]-->
<script src="assets/plugins/jquery-1.10.2.min.js" type="text/javascript"></script>
<script src="assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
<script src="assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="assets/plugins/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
<script src="assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="assets/plugins/jquery.blockui.min.js" type="text/javascript"></script>
<script src="assets/plugins/jquery.cokie.min.js" type="text/javascript"></script>
<script src="assets/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
<!-- END CORE PLUGINS -->
<!-- BEGIN PAGE LEVEL PLUGINS -->
<script src="assets/plugins/jquery-validation/dist/jquery.validate.min.js" type="text/javascript"></script>
<script type="text/javascript" src="assets/plugins/select2/select2.min.js"></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="assets/scripts/app.js" type="text/javascript"></script>
<script src="assets/scripts/login.js" type="text/javascript"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<script>
jQuery(document).ready(function() {     
  App.init();
  Login.init();
});
</script>
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>